]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
system: Do not disable suspend action when locked
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 18 Mar 2015 22:54:25 +0000 (23:54 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 27 May 2016 15:04:47 +0000 (17:04 +0200)
gnome-settings-daemon now allows the corresponding keybinding, so
for consistency it makes sense to show the button as well.

https://bugzilla.gnome.org/show_bug.cgi?id=725960

js/ui/status/system.js

index 4981d948b65ec53fd854a0f8e35ac2e14340c8e5..1d666cfb8dcde58d36d43ebdad3e1be70c604622 100644 (file)
@@ -306,14 +306,17 @@ const Indicator = new Lang.Class({
     },
 
     _updateHaveSuspend: function() {
-        this._loginManager.canSuspend(Lang.bind(this, function(result) {
-            this._haveSuspend = result;
-            this._updateSuspend();
-        }));
+        this._loginManager.canSuspend(Lang.bind(this,
+            function(canSuspend, needsAuth) {
+                this._haveSuspend = canSuspend;
+                this._suspendNeedsAuth = needsAuth;
+                this._updateSuspend();
+            }));
     },
 
     _updateSuspend: function() {
-        let disabled = Main.sessionMode.isLocked ||
+        let disabled = (Main.sessionMode.isLocked &&
+                        this._suspendNeedsAuth) ||
                        (Main.sessionMode.isGreeter &&
                         this._loginScreenSettings.get_boolean(DISABLE_RESTART_KEY));
         this._suspendAction.visible = this._haveSuspend && !disabled;